<?php
class Core_Business_Menuitem extends Core_Business_Abstract {
	private $_id;
	private $_label;
	private $_url;
	private $_order;
	private $_disabled;
	private $_parentid;
	
	public function getId() {return $this->_id;}
	public function setId($value) {$this->_id=$value;}
	public function getLabel() {return $this->_label;}
	public function setLabel($value) {$this->_label=$value;}
	public function getUrl(){return $this->_url;}
	public function setUrl($value){$this->_url=$value;}
	public function getOrder() {return $this->_order;}
	public function setOrder($value) {$this->_order=$value;}
	public function getDisabled() {return $this->_disabled;}
	public function setDisabled($value) {return $this->_disabled=$value;}
	public function getParentid() {return $this->_parentid;}
	public function setParentid($value) {$this->_parentid=$value;}
	
	public function getChild() {
	 $map = new Core_Data_Mappers_Menuitem();
	 $collection = $map->fetchAll(array("parentid = ?"=>$this->_id));
	 return $collection;
	}
	public function getParent() {
		$map = new Core_Data_Mappers_Menuitem();
		$parent = $map->find($this->_parentid);
		return $parent;
	}
	
	public static function getMenuById($id){
		$map = new Core_Data_Mappers_Menuitem();
		$menu = $map->find($id);
		return $menu;
	}
}